<!-- ueditor所需引入 -->
@layout("/layout/ueditor.html"){}
<div class="tabbable">
	<ul class="nav nav-tabs" id="myTab">
		<li class="active"><a data-toggle="tab" href="#home"> <i
				class="green ace-icon fa fa-list-alt bigger-120"></i> 字典列表
		</a></li>

		<li class=""><a data-toggle="tab" href="#profile">
		<i class="green ace-icon fa fa-plus bigger-120"></i> 字典添加
		</a></li>
	</ul>

	<div class="tab-content">
		<div id="home" class="tab-pane active clearfix">
			<form action="${ctxPath}/cmsArticle/list" method="post" id="search-form" target="list-page" class="clearfix">
				
				<div class="pull-left width-30">
					<label>描述：</label>
					<input type="text" class="width-80" name="description"/>
				</div>
				<div class="pull-left"><span class="btn btn-info btn-sm " id="search-btn">查 询</span></div>
			</form>
			<hr/>
			<div id="list-page"></div>
			<script type="text/javascript">
				$("#search-form").getPageList({'submitBtnId':'search-btn'})
			</script>
		</div>

		<div id="profile" class="tab-pane">
			<form action="${ctxPath!}/cmsArticle/save" method="post" id="cmsArticle-save-form" enctype="multipart/form-data">
			
		<div class="center padding-10">
			<label>标题：</label>
			<input type="text" class="width-50" name="title" datatype="*"  nullmsg="请输入标题！"/>
		</div>
		<div class="center padding-10">
			<label>类别：</label>
			<div class="width-50 inline text-left">
			@var wapTypeList = dict.getDictListByTypeAndSite("cms_wap_type");
					<#select name="color">
						@for(item in wapTypeList){
							<option value="${item.value!}" ${decode(item.value,office.type!,"selected","")}>
							${item.label!}
							</option>
						@}
					</#select>
					</div>
		</div>
		
		<div class="center padding-10">
			<label>图片：</label>
			<div class="width-50 inline text-left">
			<input type="file"  id="img" name="img" datatype="*"  nullmsg="请输入姓名！"/>
			</div>
		</div>
		
		<div class="center padding-10">
			<label>1为推荐：</label>
			<input type="text" class="width-50" name="weight" datatype="*"  nullmsg="请输入权重！"/>
		</div>
		<!-- <div class="center padding-10">
			<label>isWord：</label>
			<input type="text" class="width-50" name="isword" datatype="*"  nullmsg="请输入isWord！"/>
		</div>
		<div class="center padding-10">
			<label>keywords：</label>
			<input type="text" class="width-50" name="keywords" datatype="*"  nullmsg="请输入keywords！"/>
		</div> -->
		<div class="center padding-10">
			<label>分类：</label>
			<div class="width-50 inline text-left">
			<#treeselect url="cmsCategory/tree" modelName="categoryname" modelNameValue="${cmsCategory.name!}" 
							modelIdValue="${cmsCategory.id!''}" selectIds="${cmsCategory.id!}"
							modelId="categoryId" nameId="cmsCategory" id="category_id"
							isCheck="请选择分类"/>
			</div>				
			
		</div>
		
		<div class="center padding-10">
			
			<div class="width-100 inline text-left">
			<textarea  style="width:93%;height:290px" name="content" id="content"></textarea>
			</div>
		</div>
		     
		<input type="hidden" name="contentNoTag" id="contentNoTag" />
		<input type="hidden" name="description" id="description" />

		<div class="margin-t15">
			<input type="button" onclick="backValue()" class="btn btn-info btn-block bigger-120" value="保存">
		</div>
			</form>
		</div>
	</div>
</div>
<script type="text/javascript">
//上传
$('#img').ace_file_input({
	no_file:'请选择图片 ...',
	btn_choose:'选择',
	btn_change:'更改',
	droppable:false,
	onchange:null,
	thumbnail:false //| true | large
	//whitelist:'gif|png|jpg|jpeg'
	//blacklist:'exe|php'
	//onchange:''
	//
});
//日期框
$('.date-picker').datepicker();
function backValue(){
	var content=UE.getEditor('content').getContent();
	var contentNoTag=UE.getEditor('content').getContentTxt();
	var summary=UE.getEditor('content').getContentTxt().substr(0,155);

	$("#content").val(content);
	$("#contentNoTag").val(contentNoTag);
	$("#description").val(summary);
	$("#cmsArticle-save-form").submit();
	
}
function reurl(){ 
	UE.getEditor('content');
} 
setTimeout('reurl()',500); 
</script>
